import { getAction, postAction} from "./manage";

// 权限相关
export const getUserPermission = (parameter) => getAction("/getUserPermissionList", parameter);
export const login = (parameter) => postAction("/login", parameter);
export const saveSchedule = (parameter) => postAction("/saveSchedule", parameter);

// 用户管理
export const getUserList = (parameter) => getAction("/getUserList", parameter);
export const getUserInfo = (parameter) => getAction("/getUserInfo", parameter);
export const addUser = (parameter) => postAction("/addUser", parameter);
export const updateUser = (parameter) => postAction("/updateUser", parameter);
export const deleteUser = (parameter) => postAction("/deleteUser", parameter);
export const assignUserRoles = (parameter) => postAction("/assignUserRoles", parameter);

// 角色管理
export const getRoleList = (parameter) => getAction("/getRoleList", parameter);
export const getPermissionsByRoleId = (parameter) => getAction("/getPermissionsByRoleId", parameter, { roleId: parameter });
export const addRole = (parameter) => postAction("/addRole", parameter);
export const updateRole = (parameter) => postAction("/updateRole", parameter);
export const deleteRole = (parameter) => postAction("/deleteRole", parameter);
export const assignRolePermissions = (parameter) => postAction("/assignRolePermissions", parameter);

// 菜单管理
export const getMenuList = (parameter) => getAction("/getMenuList", parameter);
export const addMenu = (parameter) => postAction("/addMenu", parameter);
export const updateMenu = (parameter) => postAction("/updateMenu", parameter);
export const deleteMenu = (parameter) => postAction("/deleteMenu", parameter);

// 权限管理
export const getPermissionList = (parameter) => getAction("/getPermissionList", parameter);
export const addPermission = (parameter) => postAction("/addPermission", parameter);
export const updatePermission = (parameter) => postAction("/updatePermission", parameter);
export const deletePermission = (id) => postAction("/deletePermission", { id });